//
using UnityEngine;
using System.Collections;

public class Listener : MonoBehaviour, IListener
{
		
	// Use this for initialization
	void Start ()
	{
		//if (op_notificationManager != null)
		//{
		//	op_notificationManager.AddListener(this, op_eventType);
		//}
		NotificationManager.Instance.AddListener(this, op_eventType);
	}


	//--------- interface
	//public GameEnum.EventType m_eventType{get; set;}
	public GameEnum.EventType op_eventType;
	//public NotificationManager op_notificationManager;

	public void OnNotificationReceived(Component sender)
	{
		switch (op_eventType)
		{
		case GameEnum.EventType.OnUserPressDown:
			Debug.Log("Listner : OnUserPressDown !! para : " + ((Poster)sender).m_property );
			break;
		case GameEnum.EventType.OnUserPressLeft:
			Debug.Log("Listner : OnUserPressLeft !! para : " + ((Poster)sender).m_property );
			break;
		case GameEnum.EventType.OnUserPressRight:
			Debug.Log("Listner : OnUserPressRight !! para : " + ((Poster)sender).m_property );
			break;
		case GameEnum.EventType.OnUserPressUp:
			Debug.Log("Listner : OnUserPressUp !! para : " + ((Poster)sender).m_property );
			break;
		}
	}
}

